import matplotlib.pyplot as plt
import numpy as np
from scipy import signal

tmin = 0
tmax = 10
T = 0.01
t = np.arange(tmin, tmax, T)


def u(n):
   return np.where(n > 0, 1,0)


# 定义系统模型
num = np.array([0.0, 1.0, 1.0])
den = np.array([1.0, 25.0, 1.0])
system = signal.lti(num, den)

tout1, yout1 = signal.impulse(system)  # 单位冲激响应
tout2, yout2 = signal.step(system)  # 单位冲激响应

plt.subplot(211)
plt.plot(tout1, yout1)

plt.subplot(212)
plt.plot(tout2, yout2)

plt.show()
